<script type="text/javascript" src="<?php echo base_url();?>public/ckeditor/ckeditor.js"></script>
<div class="editcate_top">
    <h2>Thêm mới tin tức</h2>
    <a href="javascript:void(0)" onclick ="$('#light_adct').hide();$('#fade_adct').hide()"><img src="<?php echo img_link('close.png', 'admin'); ?>" class="png" /></a>
</div>

<?php if($this->message->has('error')):?>
	<div><h2><?php echo $this->message->display();?></h2></div>
<?php endif;?>

<form enctype="multipart/form-data" method="post" action="" id="articles_form">
<div class="editcate_ct">
	<div class="btarticle">
    	<input type="button" value="Cancel" class="btn" onclick="$('#light_adct').hide();$('#fade_adct').hide();" />
        <input type="submit" value="Save & Continute" class="btn" />
    </div>
	<div class="boxadd">
    	<ul class="linect">     	   	
            <li>
                <span class="left"><b>Tiêu đề<font color="red">(*)</font> :</b></span>
                <span class="right"><input type="text" name="txt_title" value="<?php echo(isset($form_submit['title']) ? $form_submit['title'] : '');?>" style="width:70%; margin:0;" /></span>
            </li>
            <li>
                <span class="left"><b>Chuyên mục<font color="red">(*)</font> :</b></span>
                <span class="right">
                	<select name="cat" id="cat">
                	<?php foreach($cats as $k => $v):?>
                		<option <?php echo(isset($form_submit['cat_id']) && $form_submit['cat_id'] == $v->id ? 'selected="selected"' : '' );?> value="<?php echo $v->id;?>"><?php echo $v->name;?></option>
                	<?php endforeach;?>
                	</select>
                </span>
            </li>
            <?php if($func == 'update'):?>
            <li>
                <span class="left">Ảnh minh họa</span>
                <span class="right">                	                	
                	<input type="file" name="image" value="" /><br />                	
                </span>
            </li>
            <li>
            	<span class="left">Mô tả</span>
            	<span class="right">
                	<textarea id="txt_desc" name="txt_desc" style="width:82%; height:150px;"><?php echo(isset($form_submit['desc']) ? $form_submit['desc'] : '');?></textarea>
                </span>            	
            </li>   
            <?php endif;?>
            <li>
            	<span class="left"><b>Nội dung:<font color="red">(*)</font></b></span>
                <span class="right"><textarea id="txt_content" name="txt_content"  style="width:700px; height:200px;"><?php echo(isset($form_submit['content']) ? $form_submit['content'] : '');?></textarea></span>
                <script type="text/javascript">
				$(function() {	
					if(CKEDITOR.instances['txt_content']) {						
						CKEDITOR.remove(CKEDITOR.instances['txt_content']);
					}
					CKEDITOR.config.width = 700;
				    CKEDITOR.config.height = 400;
					CKEDITOR.replace('txt_content',{
				    	toolbar :
				    		[['Source','Maximize','-','Format','Font','FontSize'],'/',
				    		 ['PasteText','PasteFromWord'],
					         ['TextColor','BGColor','-','Bold','Italic','Underline'],
					         ['NumberedList','BulletedList'],'/',
					         ['Outdent','Indent','Blockquote'],
					         ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
					         ['Image','Table','-', 'Link', 'Unlink' ]]
					});
				})
				</script>                
            </li>   
            <?php if($func == 'update'):?>
            <li>
                <span class="left"><b>Nổi bật:</b></span>
                <span class="right"><input <?php echo(isset($form_submit['hot']) && $form_submit['hot'] == 1  ? 'checked="checked"' : '' );?> type="checkbox" name="hot" value="1" id="hot" /></span>
            </li> 
            <?php endif;?>        
       		<li>
       			<span class="left"><b>Kích hoạt:</b></span>
       			 <span class="right">
                    <input type="checkbox" <?php echo(isset($form_submit['active']) && $form_submit['active'] == 1 ? 'checked="checked"' : '' );?> name="active" id="active" value="1"/>
                </span>
       		</li>
       		
        </ul>
    </div>
    <div class="btarticle">
    	<input type="button" value="Cancel" class="btn" onclick="$('#light_adct').hide();$('#fade_adct').hide();" />
        <input type="submit" value="Save & Continute" class="btn" />

    </div>
</div>
</form>